<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="{$smarty.const.__PUBLIC_JS__}/jquery-3.1.1.js"></script>
    <script type="text/javascript" src="{$smarty.const.__PUBLIC_JS__}/jquery.min.js"></script>
    <script type="text/javascript" src="{$smarty.const.__PUBLIC_JS__}/ajaxfileupload.js"></script>
    <script type="text/javascript" src="{$smarty.const.__PUBLIC_JS__}/consult_message.js"></script>



</head>
<body>
<!--这里是标记用哪一个数据库的 不能删除-->
<input type="hidden" id="which_DB" value="ssg_banner">
<form method="get" action="{$smarty.const.__CONTROLLER__}/advertisement">
    <input type="text" id="find_goods" name="find_goods">
    <input type="submit" value="搜索">
</form>
<input type="button" onclick='is_over("{$num}")' value="添加">
<div id="insert_data" style="display: none; position: absolute; top: 50%;left: 40%;">
    <form onsubmit='return send_data("{$smarty.const.__CONTROLLER__}/upload_photo","add")' method="post"
          enctype="multipart/form-data">
        标题:<input type="text" name="title" id="title_add">
        商品标号:<input type="text" name="goodsCode" id="goodsCode_add">
        上传图片:<input type="file" name="photo" id="photo_add">
        <input type="submit" value="添加">
    </form>
</div>
<div>
    {foreach $goods_list as $k => $v}
    <div>
        <div>{$v@iteration}</div>
        <div><img src="{$v.image}" style="width: 64px;height: 64px;"></div>
        <div>{$v.title}</div>
        <div>{$v.goodsCode}</div>
        <div>{$v.time}</div>
        {if $v.isValid == 1}
        <div>有效</div>
        {elseif $v.isValid == 0}
        <div>无效</div>
        {/if}
        <input type="button" value="编辑"
               onclick='update_data("{$v.id}","{$smarty.const.__CONTROLLER__}/updateNewGoods")'>
        <input type="button" value="删除"
               onclick='delete_data("{$v.id}","{$smarty.const.__CONTROLLER__}/deleteNewGoods")'>
    </div>
    {/foreach}
</div>
{$page_list}
<div style="display: none;position: absolute ;top: 50%;left: 40%" id="prompt">
    <form onsubmit='return send_data_best("{$smarty.const.__CONTROLLER__}/upload_photo","update")'>
        <input type="hidden" name="hidden_id" id="hidden_id">
        标题:<input id="title" type="text" name="title" value="">
        商品标号:<input id="goodsCode" type="text" name="goodsCode" value="">
        <input type="submit" value="提交">
    </form>
</div>
</body>
</html>